import Vue from './instance/index'
import api from './api'

api.filter('money', cash=> {
    return cash + '$'
});

let app = new Vue('#test', {
    data: {
        msg: 'hello world',
        vue: 'vue-js 源码实战!',
        cash: '100',
        showRedBox: true,
        show: true,
    },
    methods: {
        toggleRedBox(){
            app.showRedBox = !app.showRedBox;
        },
        toggleGreenBox(){
            app.show = !app.show;
        },
        reverse(e){
            app.msg = app.msg.split('').reverse().join("");
            console.log(e)
        }
    }
});